package com.example.examsystem.enums;

/**
 * 试题类型枚举
 */
public enum QuestionType {
    SINGLE_CHOICE("单选题"),
    MULTIPLE_CHOICE("多选题"),
    TRUE_FALSE("判断题"),
    FILL_BLANK("填空题"),
    SHORT_ANSWER("简答题"),
    ESSAY("问答题");
    
    private final String description;
    
    QuestionType(String description) {
        this.description = description;
    }
    
    public String getDescription() {
        return description;
    }

    /**
     * 根据题型名称获取题型描述
     * @param type 题型类型
     * @return 题型名称
     */
    public String getTypeName(String type) {
        for (QuestionType value : QuestionType.values()){
            if (value.name().equals(type)){
                return value.getDescription();
            }
        }
        return "未知题型";
    }
}
